package com.java.tutorials.jdk7.paths;

import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * Created by xuzhike on 2016/1/27.
 * http://www.java2s.com/Code/Java/JDK-7/GetthesubpathfromaPathobject.htm
 * Get the sub path from a Path object
 */
public class GetthesubpathfromaPathobject {
    public static void main(String[] args) throws Exception{

        Path listing = Paths.get("E:\\OpenSources\\MyProjects\\test");

        System.out.println("Subpath from Root, 2 elements deep [" + listing.subpath(0, 2) + "]");

    }
}
